import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/views/Login";
import Register from "@/views/Register";
import Detail from "@/views/Detail";
import Layout from "@/views/Layout";

import Like from "@/views/like";
import Article from "@/views/article";
import Collect from "@/views/collect";
import User from "@/views/user";


Vue.use(VueRouter);
const router = new VueRouter({
  routes: [
    { path: "/login", component: Login },
    { path: "/register", component: Register },
    { path: "/detail/:id", component: Detail },
    {
      path: "/", component: Layout,
      redirect: "/article",
      children: [
        { path: "article", component: Article },
        { path: "like", component: Like },
        { path: "collect", component: Collect },
        { path: "user", component: User }]

    },
  ],
});
export default router;

